/*
 * @author zei, QQ:77132995, email:kazeik@163.com
 * 2022/3/10 09:48
 * 类说明:
 */
import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/src/entities/data_import_entity.dart';

class ContentDataImportEntity with JsonConvert<ContentDataImportEntity> {
  List<DataImportEntity> dataMapped;
  TypesCount typesCount;

  ContentDataImportEntity({this.dataMapped, this.typesCount});

  factory ContentDataImportEntity.fromJson(Map<String, dynamic> json) {
    return ContentDataImportEntity(
      dataMapped: json['dataMapped'] != null ? (json['dataMapped'] as List).map((v) => DataImportEntity().fromJson(v)).toList() : null,
      typesCount: json['typesCount'] != null ? TypesCount.fromJson(json['typesCount']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.dataMapped != null) {
      data['dataMapped'] = this.dataMapped.map((v) => v.toJson()).toList();
    }
    if (this.typesCount != null) {
      data['typesCount'] = this.typesCount.toJson();
    }
    return data;
  }
}

class TypesCount {
  int customer;

  TypesCount({this.customer});

  factory TypesCount.fromJson(Map<String, dynamic> json) {
    return TypesCount(
      customer: json['Customer'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Customer'] = this.customer;
    return data;
  }
}
